

import request from '@/router/axios'

const prefix = '/rca/swckclearrules'

export function fetchList (query) {
  return request({
    url: prefix + '/page',
    method: 'get',
    params: query
  })
}


export function fetchListB (query) {
  return request({
    url: prefix + '/pageList',
    method: 'get',
    params: query
  })
}

export function delObj (query) {
  return request({
    url: prefix + '/removeByIds',
    method: 'get',
    params: query
  })
}

export function addObj (obj) {
  return request({
    url: prefix + '/swckclearrulesAdd',
    method: 'post',
    data: obj
  })
}

export function putObj (obj) {
  return request({
    url: prefix + '/swckclearrulesEdit',
    method: 'put',
    data: obj
  })
}

export function updateOneSidedSales (obj) {
  return request({
    url: prefix + '/updateOneSidedSales',
    method: 'put',
    data: obj
  })
}

export function getObj (id) {
  return request({
    url: prefix + '/getDetail/' + id,
    method: 'get'
  })
}

export function dataExport (query) {
  return request({
    url: prefix + '/export',
    method: 'get',
    responseType: 'blob',
    params: query
  })
}

export function listoperators () {
  return request({
    url: prefix + '/listoperators',
    method: 'get'
  })
}

export function updateUsedStateToStop (ids) {
  return request({
    url: prefix + '/updateUsedStateToStop',
    method: 'get',
    params: { ids }
  })
}

export function updateUsedStateToUse (ids) {
  return request({
    url: prefix + '/updateUsedStateToUse',
    method: 'get',
    params: { ids }
  })
}

export function autoCompute (query) {
  return request({
    url: prefix + '/autoCompute',
    method: 'get',
    params: query
  })
}


export function autoComputeMonth (query) {
  return request({
    url: prefix + '/autoComputeMonth',
    method: 'get',
    params: query
  })
}

export function autoComputeDay (query) {
  return request({
    url: prefix + '/autoComputeDay',
    method: 'get',
    params: query
  })
}

export function previewLine (id) {
  return request({
    url: '/rca/swckclearrulesline' + '/previewLine',
    method: 'get',
    params: { id }
  })
}

export function getLines (operatorsId) {
  return request({
    url: '/support/swparamline/getLineByOperators',
    method: 'get',
    params: { operatorsId }
  })
}

export function getOneSidedLines (cleanDate) {
  return request({
    url: prefix + '/getOneSidedLines',
    method: 'get',
    params: { cleanDate }
  })
}


